package cn.myblog.ainblog.mapper;

import cn.myblog.ainblog.model.CommentModel;
import cn.myblog.ainblog.vo.ArticleCategoryVO;
import cn.myblog.ainblog.vo.CommentAndArticleVO;
import cn.myblog.ainblog.vo.CommentReplyVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.scheduling.support.SimpleTriggerContext;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Dovaior
 * @Description 评论的mapper层
 * @create 2021-05-06 21:31
 **/
@Repository
public interface CommentMapper extends BaseMapper<CommentModel> {
    //查询指定博文的评论
    List<CommentModel> queryCommentByArticleId(String articleId);
    //分页查询评论---VO
    IPage<CommentAndArticleVO> selectCommentListPage(IPage<CommentAndArticleVO> page);
    //分页查询评论---model
    IPage<CommentModel> selectCommentPage(IPage<CommentModel> page,String articleId);
    //根据博文id删除全部留言
    int deleteAllCommentByArticleId(String articleId);
    //查询指定博文的全部留言id
    List<Long> queryCommentIdsByArticleId(String articleId);
    //查询指定留言的id和内容
    String queryCommentContentByCommentId(Long commentId);
    //判断回复状态
    int isReplyStatus(Long commentId);
    //修改回复状态为已回复
    int changeStatus(Long commentId);
    //修改回复状态为未回复
    int deChangeStatus(Long commentId);
    //查询指定的博文的全部留言及回复
    List<CommentReplyVO> queryAllCommentAndReplyMsgByArticleId(String articleId);
}
